package com.lightboat.system.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.lightboat.common.annotation.Excel;
import com.lightboat.common.core.domain.BaseEntity;
import io.swagger.v3.oas.annotations.media.SchemaProperty;
import lombok.*;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * 通知公告表 sys_notice
 *
 * @author lightboat
 */
@EqualsAndHashCode(callSuper = true)
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class SysNotice extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 公告ID
     */
    @SchemaProperty(name = "公告ID")
    @TableId
    private Long noticeId;

    /**
     * 公告标题
     */
    @SchemaProperty(name = "公告标题")
    @Excel(name = "公告标题")
    private String noticeTitle;

    /**
     * 公告类型（1通知 2公告）
     */
    @SchemaProperty(name = "公告类型（1通知 2公告）")
    @Excel(name = "公告类型", readConverterExp = "1=通知,2=公告")
    private String noticeType;

    /**
     * 消息类型（1退货通知 2发货通知 3签收通知）
     */
    @SchemaProperty(name = "消息类型（1退货通知 2发货通知 3签收通知）")
    @Excel(name = "消息类型", readConverterExp = "1=退货通知,2=发货通知,3=签收通知")
    private String msgType;

    /**
     * 部门ID
     */
    @SchemaProperty(name = "部门ID")
    @Excel(name = "部门ID")
    private Long deptId;

    /**
     * 接收用户ID
     */
    @SchemaProperty(name = "接收用户ID")
    @Excel(name = "接收用户ID")
    private Long userId;

    /**
     * 发送用户ID
     */
    @SchemaProperty(name = "发送用户ID")
    @Excel(name = "发送用户ID")
    private Long sendId;

    /**
     * 是否已读（0否 1是）
     */
    @SchemaProperty(name = "是否已读（0否 1是）")
    @Excel(name = "是否已读", readConverterExp = "0=否,1=是")
    private Integer isRead;

    /**
     * 公告内容
     */
    @SchemaProperty(name = "公告内容")
    @Excel(name = "公告内容")
    private String noticeContent;

    /**
     * 公告状态（0正常 1关闭）
     */
    @SchemaProperty(name = "公告状态（0正常 1关闭）")
    @Excel(name = "公告状态", readConverterExp = "0=正常,1=关闭")
    private String status;

    /**
     * 角色编码
     */
    @SchemaProperty(name = "角色编码")
    @Excel(name = "角色编码")
    @TableField(exist = false)
    private String roleCode;

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("noticeId", getNoticeId())
                .append("noticeTitle", getNoticeTitle())
                .append("noticeType", getNoticeType())
                .append("noticeContent", getNoticeContent())
                .append("status", getStatus())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .append("remark", getRemark())
                .toString();
    }
}
